package com.example.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.web.entity.Forum;
import com.example.web.entity.vo.ForumVo;
import com.example.web.mapper.ForumMapper;
import com.example.web.service.ForumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * (Forum)表服务实现类
 *
 * @author makejava
 * @since 2024-05-05 12:53:45
 */
@Service("forumService")
public class ForumServiceImpl extends ServiceImpl<ForumMapper, Forum> implements ForumService {
    @Autowired
    private ForumMapper forumMapper;

    @Override
    public Object getList(ForumVo ForumVo) {
        Page<Forum> page = new Page<>(ForumVo.getPageNum(),ForumVo.getPageSize());
        QueryWrapper<Forum> wrapper = new QueryWrapper<>();
//        if(!StringUtils.isEmpty(ForumVo.getPerson())){
//            wrapper.like("person",ForumVo.getPerson());
//        }
//        if(!SaFoxUtil.isEmpty(ForumVo.getForumd())){
//            wrapper.like("Forumd",ForumVo.getForumd());
//        }
//        if(!SaFoxUtil.isEmpty(ForumVo.getForumType())){
//            wrapper.like("Forum_type",ForumVo.getForumType());
//        }
        return forumMapper.selectPage(page,wrapper);
    }

}
